﻿<UserControl x:Class="AnalysisTesteur.Views.SheetControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:avalonDock="http://schemas.xceed.com/wpf/xaml/avalondock"
             mc:Ignorable="d"  BorderBrush="{x:Null}" BorderThickness="0"
		    xmlns:viewModels="clr-namespace:AnalysisTesteur.ViewModels"    
		    xmlns:Models="clr-namespace:AnalysisTesteur.Models"            
            xmlns:converters="clr-namespace:AnalysisTesteur.Converters"
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.DataContext>
        <Models:DashboardSheet />
    </UserControl.DataContext>
    <UserControl.Resources>
        <Style TargetType="Control">
            <Setter Property="BorderBrush" Value="{x:Null}" />
            <Setter Property="BorderThickness" Value="0" />
        </Style>
    </UserControl.Resources>
    <Grid>
        <avalonDock:DockingManager BorderBrush="{x:Null}" BorderThickness="0" Margin="0" Padding="0"
            AllowMixedOrientation="True"
            Name="DockingManager" 
            Background="White" AnchorablesSource="{Binding Path=DashboardItemList}" ActiveContent="{Binding Path=ActiveDashboardItem, Mode=TwoWay}">

            <avalonDock:DockingManager.AnchorableHeaderTemplate >
                <DataTemplate>
                    <TextBlock Text="{Binding Content.Caption}" />
                </DataTemplate>
            </avalonDock:DockingManager.AnchorableHeaderTemplate>

            <avalonDock:DockingManager.LayoutItemTemplate>
                <DataTemplate>
                    <ContentPresenter Content="{Binding View}" />
                </DataTemplate>
            </avalonDock:DockingManager.LayoutItemTemplate>

            <avalonDock:DockingManager.AnchorableTitleTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Content.Caption}" >
                            <TextBlock.Style>
                                <Style>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding Content.IsSelected}" Value="True">
                                            <Setter Property="TextBlock.Foreground" Value="Red" />
                                            <Setter Property="TextBlock.FontStyle" Value="Italic" />
                                            <Setter Property="TextBlock.FontWeight" Value="Bold" />
                                            <Setter Property="TextBlock.FontSize" Value="12" />
                                        </DataTrigger>
                                    </Style.Triggers> 
                                </Style>                              
                            </TextBlock.Style>
                    </TextBlock>
                </DataTemplate>
            </avalonDock:DockingManager.AnchorableTitleTemplate>

            <avalonDock:DockingManager.LayoutItemContainerStyle>
                <Style >
                    <Setter Property="avalonDock:LayoutItem.IsActive" Value="{Binding Model.IsSelected, Mode=TwoWay}" />
                    <Setter Property="avalonDock:LayoutItem.CanClose" Value="False" />
                    <Setter Property="avalonDock:LayoutAnchorableItem.CanHide" Value="False" />
                    <Setter Property="avalonDock:LayoutAnchorableItem.AutoHideCommand" Value="{Binding Model.AutoHide}" />
                    <Setter Property="avalonDock:LayoutAnchorableItem.HideCommand" Value="{Binding Model.AutoHide}" />
                    <Setter Property="avalonDock:LayoutItem.IconSource" Value="/AnalysisTesteur;component/Resources/Images/smile.gif" />
                </Style>
            </avalonDock:DockingManager.LayoutItemContainerStyle>

          
            <avalonDock:LayoutRoot>
                <avalonDock:LayoutPanel Orientation="Horizontal" >

                </avalonDock:LayoutPanel>
            </avalonDock:LayoutRoot>
        </avalonDock:DockingManager>
    </Grid>
</UserControl>
